package youdaoNote

import (
	"log"
	"net/http"
)

func init() {

}

func Login(username, password string) (s *http.Request, err error) {
	client := &http.Client{}
	url := "https://note.youdao.com/web/"
	req, err := http.NewRequest("GET", url, nil)
	//if err != nil {
	//	log.Println("Error happend while creating HTTP request.")
	//	panic(err)
	//}

	// define HTTP request headers
	req.Header.Add("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36")
	req.Header.Add("Accept", "*/*")
	req.Header.Add("Accept-Encoding", "gzip, deflate, br")
	req.Header.Add("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")

	res, err := client.Do(req)
	//defer res.Body.Close()

	log.Println(res)

	//req.Header.Add("Referer", "https://note.youdao.com/web/")

	s = req
	return s, err
}
